package com.css.zfzx.sjcj.modules.hddcB7_VolcanicSvyProjectTable.repository;

import com.css.zfzx.sjcj.modules.hddcA1InvRgnHasMaterialTable.repository.entity.HddcA1InvrgnhasmaterialtableEntity;
import com.css.zfzx.sjcj.modules.hddcB7_VolcanicSvyProjectTable.repository.entity.HddcB7VolcanicsvyprojecttableEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * @author zhangcong
 * @date 2020-11-26
 */
public interface HddcB7VolcanicsvyprojecttableRepository extends JpaRepository<HddcB7VolcanicsvyprojecttableEntity, String> {
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_b7_volcanicsvyprojecttable set qualityinspection_status=:qualityinspection_status ,extends1=:extend1 where workregionid=:workregionid")
    void updateStatus(String qualityinspection_status, String extend1, String workregionid);
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_b7_volcanicsvyprojecttable set qualityinspection_status=:qualityinspection_status ,extends2=:extend2 where targetregionid=:targetregionid")
    void updateStatus2(String qualityinspection_status, String extend2, String targetregionid);
    @Modifying
    @Query(nativeQuery = true,value = "update hddc_b7_volcanicsvyprojecttable set qualityinspection_status=:s,extends3=:str where mainafsregionid=:id")
    void updateStatus3(String s, String str, String id);

    @Query(nativeQuery = true,value = "select * from hddc_b7_volcanicsvyprojecttable where is_valid=1 and extends10=1 ")
    List<HddcB7VolcanicsvyprojecttableEntity> findByAll();

    HddcB7VolcanicsvyprojecttableEntity findByUuidAndIsValid(String id, String isValid);
}
